package com.liarjo.mywebsiteapi.admin.controller.user;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.liarjo.mywebsiteapi.admin.controller.user.page.UserPageRequest;
import com.liarjo.mywebsiteapi.admin.controller.user.page.UserPageResult;


@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public IPage<UserPageResult> page(UserPageRequest userPageRequest) {
        IPage<UserPageResult> page = new Page<>(userPageRequest.getCurrent(),userPageRequest.getSize());
        IPage<UserPageResult> pageResult = userMapper.page(userPageRequest, page);
        return pageResult;
    }
}
